/*
 *    Copyright (c) 2018-2025, nart All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: nart
 */

package com.nai365.nart.operation.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nai365.nart.operation.dto.PledgeDemandDto;
import com.nai365.nart.operation.dto.SpuDto;
import com.nai365.nart.operation.entity.PledgeDemand;

import java.util.Map;

/**
 * 质押需求
 *
 * @author baogs
 * @date 2022-07-01 11:13:17
 */
public interface PledgeDemandService extends IService<PledgeDemand> {

	/**
	 * 质押需求分页查询
	 *
	 * @param page         分页对象
	 * @param queryWrapper 查询条件
	 * @return 质押需求Dto分页对象
	 */
	Page<PledgeDemandDto> page(Page<PledgeDemand> page, QueryWrapper<PledgeDemand> queryWrapper);

	/**
	 * 将质押需求转化为Dto对象
	 *
	 * @param pledgeDemand 质押需求实体
	 * @param spuDtoMap    spu map
	 * @return 质押需求Dto
	 */
	PledgeDemandDto pledgeDemand2PledgeDemandDto(PledgeDemand pledgeDemand, Map<Long, SpuDto> spuDtoMap);

	/**
	 * 根据id查询质押需求
	 *
	 * @param id 质押需求Id
	 * @return 质押需求Dto
	 */
	PledgeDemandDto getPledgeDemandDtoById(Long id);

}
